package com.lj.infoisland.util;

import com.lj.infoisland.domain.dto.HotSearchDTO;
import com.lj.infoisland.domain.po.HotSearchRecord;

public class HotSearchConvert {
    public static HotSearchDTO toDTOWhenQuery(HotSearchRecord hotSearchRecord) {
        return HotSearchDTO.builder()
                //热搜作者
                .hotSearchAuthor(hotSearchRecord.getHotSearchAuthor())
                //热搜作者头像
                .hotSearchAuthorAvatar(hotSearchRecord.getHotSearchAuthorAvatar())
                //热搜封面
                .hotSearchCover(hotSearchRecord.getHotSearchCover())
                //热度
                .hotSearchHeat(hotSearchRecord.getHotSearchHeat())
                //热搜id
                .hotSearchId(hotSearchRecord.getHotSearchId())
                //热搜摘要
                .hotSearchExcerpt(hotSearchRecord.getHotSearchExcerpt())
                //热搜排序
                .hotSearchOrder(hotSearchRecord.getHotSearchOrder())
                //热搜来源
                .hotSearchResource(hotSearchRecord.getHotSearchResource())
                //热搜标题
                .hotSearchTitle(hotSearchRecord.getHotSearchTitle())
                //热搜链接
                .hotSearchUrl(hotSearchRecord.getHotSearchUrl())
                //物理主键
                .id(hotSearchRecord.getId()).build();
    }
}